package main

import (
	"api_admin_server/internal/routers"
	"fmt"
	"net/http"
	"time"

	common "jihe.common"
)

func main() {
	new(common.Redis).Get()
	srv := &http.Server{
		Addr:         fmt.Sprintf(":%d", common.Configer.Http.Port),
		Handler:      routers.Run(),
		ReadTimeout:  30 * time.Second,
		WriteTimeout: 30 * time.Second,
	}
	fmt.Printf("server started at %v \n", time.Now())
	// 监听请求
	if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
		panic(err)
	}
}
